<template>
    <div class="software-copyright">
        <div class="hero-section">
            <el-row justify="center">
                <el-col :xs="24" :sm="20" :md="16" :lg="14">
                    <h1>专业软件著作权代理服务</h1>
                    <div class="feature-list">
                        <div class="feature-item">
                            <el-icon><Timer /></el-icon>
                            <span>快速</span>
                        </div>
                        <div class="feature-dot"></div>
                        <div class="feature-item">
                            <el-icon><TrendCharts /></el-icon>
                            <span>专业</span>
                        </div>
                        <div class="feature-dot"></div>
                        <div class="feature-item">
                            <el-icon><Select /></el-icon>
                            <span>放心</span>
                        </div>
                    </div>
                </el-col>
            </el-row>
        </div>

        <div class="price-section section">
            <el-row justify="center">
                <el-col :xs="24" :sm="20" :md="16" :lg="14">
                    <el-row :gutter="20">
                        <el-col :xs="24" :sm="24" :md="12">
                            <div class="price-content">
                                <h2>软件著作权登记</h2>
                                <div class="price-value">
                                    <div class="price-tag">
                                        <span class="currency">¥</span>
                                        <span class="amount">299</span>
                                        <span class="unit">起</span>
                                    </div>
                                </div>
                                <p class="price-desc">专业服务 · 极速办理 · 安全可靠</p>
                            </div>
                        </el-col>
                        <el-col :xs="24" :sm="24" :md="12">
                            <div class="service-features">
                                <div class="service-item">
                                    <el-icon class="feature-icon"><Document /></el-icon>
                                    <span>全程办理</span>
                                </div>
                                <div class="service-item">
                                    <el-icon class="feature-icon"><Files /></el-icon>
                                    <span>无需资料</span>
                                </div>
                                <div class="service-item">
                                    <el-icon class="feature-icon"><Timer /></el-icon>
                                    <span>快速出证</span>
                                </div>
                            </div>
                        </el-col>
                    </el-row>
                </el-col>
            </el-row>
        </div>

        <div class="contact-section section">
            <el-row justify="center">
                <el-col :xs="24" :sm="20" :md="16" :lg="14">
                    <el-row :gutter="20">
                        <el-col :xs="24" :sm="24" :md="12">
                            <div class="contact-content">
                                <h2>立即咨询</h2>
                                <p class="contact-desc">留下您的微信，我们会第一时间联系您</p>
                            </div>
                        </el-col>
                        <el-col :xs="24" :sm="24" :md="12">
                            <div class="contact-form">
                                <el-input
                                    v-model="contactForm.wechat"
                                    placeholder="请输入您的微信号"
                                    :prefix-icon="ChatDotSquare"
                                />
                                <el-button type="primary" @click="submitForm" round>
                                    立即获取报价
                                </el-button>
                            </div>
                        </el-col>
                    </el-row>
                </el-col>
            </el-row>
        </div>
    </div>
</template>

<script setup>
import { ref } from 'vue'
import { Document, ChatDotSquare, Timer, TrendCharts, Select, Files } from '@element-plus/icons-vue'
import { ElMessage } from 'element-plus'
import { saveService } from '../api/service'

const contactForm = ref({
    wechat: ''
})

const submitForm = async () => {
    if (!contactForm.value.wechat) {
        ElMessage.warning('请输入微信号')
        return
    }
    
    try {
        await saveService({
            type: 1,
            weChat: contactForm.value.wechat
        })
        ElMessage.success('提交成功，我们会尽快联系您！')
        contactForm.value.wechat = ''
    } catch (error) {
        console.error('提交失败:', error)
        ElMessage.error('提交失败，请稍后重试')
    }
}
</script>

<style scoped>

.software-copyright {
    min-height: 100vh;
    background-color: var(--el-bg-color);
}

.hero-section {
    padding: 40px 20px;
    background: var(--el-bg-color);
    text-align: center;
    border-bottom: 1px solid var(--el-border-color-lighter);
}

.hero-section h1 {
    font-size: 2rem;
    color: var(--el-text-color-primary);
    margin-bottom: 2rem;
    font-weight: 600;
}

.feature-list {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 2rem;
    background: var(--el-color-primary-light-9);
    color: var(--el-color-primary);
    transition: all 0.3s;
}

.feature-item:hover {
    transform: translateY(-2px);
    background: var(--el-color-primary-light-8);
}

.feature-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--el-border-color);
    display: none;
}

.content-container {
    margin: 0 auto;
    padding: 2rem 1rem;
}

.section {
    padding: 40px 20px;
    background: var(--el-bg-color);
    text-align: center;
    border-bottom: 1px solid var(--el-border-color-lighter);
}

.price-section h2,
.contact-section h2 {
    font-size: 2rem;
    color: var(--el-text-color-primary);
    margin-bottom: 2rem;
    font-weight: 600;
}

.price-content, .contact-content {
    margin-bottom: 2rem;
}

.price-value {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

.price-tag {
    background: var(--el-color-primary-light-9);
    padding: 1rem 2rem;
    border-radius: 1rem;
    display: inline-flex;
    align-items: baseline;
    box-shadow: 0 4px 12px rgba(var(--el-color-primary-rgb), 0.1);
}

.currency {
    font-size: 2rem;
    color: var(--el-color-primary);
    margin-right: 0.25rem;
}

.amount {
    font-size: 4rem;
    font-weight: bold;
    color: var(--el-color-primary);
    line-height: 1;
}

.unit {
    font-size: 1.2rem;
    color: var(--el-color-primary);
    margin-left: 0.5rem;
}

.service-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    padding: 1rem;
}

.service-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 1rem;
    background: var(--el-color-primary-light-9);
    border-radius: 1rem;
    transition: all 0.3s ease;
}

.service-item:hover {
    transform: translateY(-4px);
    background: var(--el-color-primary-light-8);
}

.feature-icon {
    font-size: 2rem;
    color: var(--el-color-primary);
    background: white;
    padding: 0.75rem;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(var(--el-color-primary-rgb), 0.1);
}

.service-item span {
    font-size: 1rem;
    color: var(--el-color-primary);
    font-weight: 500;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 400px;
    margin: 0 auto;
}

.contact-desc {
    color: var(--el-text-color-secondary);
    font-size: 1rem;
    margin-bottom: 1rem;
}

.el-input {
    --el-input-height: 50px;
    margin-bottom: 1rem;
}

.el-button {
    height: 50px;
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    .feature-dot {
        display: none;
    }
    
    .feature-list {
        flex-direction: column;
    }
    
    .service-tags {
        justify-content: center;
    }
    
    .price-content, .contact-content {
        text-align: center;
    }

    .section {
        padding: 30px 15px;
    }
    
    .price-content, .contact-content {
        margin-bottom: 1.5rem;
    }
    
    .contact-form {
        padding: 0 1rem;
    }

    .service-features {
        grid-template-columns: repeat(1, 1fr);
        max-width: 300px;
        margin: 0 auto;
    }

    .price-tag {
        padding: 0.75rem 1.5rem;
    }

    .amount {
        font-size: 3rem;
    }
}
</style>